package com.example.kotlinstudy.ui

import android.content.AbstractThreadedSyncAdapter
import android.content.Intent
import android.content.IntentFilter
import android.os.Bundle
import android.util.Log
import android.view.ContextMenu
import android.view.Menu
import android.view.MenuItem
import android.view.View
import android.widget.Button
import android.widget.Toast
import androidx.recyclerview.widget.LinearLayoutManager
import com.example.baselibrary.base.BaseActivity
import com.example.kotlinstudy.R
import com.example.kotlinstudy.test.TimeChangeReceiver
import com.example.kotlinstudy.test.letterCount
import kotlinx.android.synthetic.main.activity_main.*
import java.time.Duration

class MainActivity : BaseActivity() {

    //声明全局变量
    lateinit var timeChangeReceiver: TimeChangeReceiver

    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)


    }

    override fun initLayout(): Int {
        return R.layout.activity_main
    }

    override fun initView() {




    }

    override fun initData() {




    }

    override fun onCreateOptionsMenu(menu: Menu?): Boolean {
        menuInflater.inflate(R.menu.main, menu)
        return true
    }

    override fun onOptionsItemSelected(item: MenuItem): Boolean {

        when (item.itemId) {
            R.id.add_item -> Log.d(this.javaClass.toString(), "add")
            R.id.remove_item -> Log.d(this.javaClass.toString(), "remove")
        }

        return true
    }

    override fun onDestroy() {
        super.onDestroy()

    }
}